
<template>
	
	<view class="content bg-#F6F9F8 h-100vh">
		
		
		<text></text>
		<!-- 头 -->
		<custom_navbar title="推荐路线" :theme="theme" @getNavHeight="getNavHeight" />


		

		

		<!-- 地图导览 -->
		<map_nav :NavHeight_infoHeight="NavHeight_infoHeight" />
		

		
	</view>
</template>

<script>
	import { navigateTo, navigateBack, redirectTo } from '@/hooks';
	import custom_navbar from '@/components/custom_navbar/index.vue';


	import map_nav from './components/map_nav.vue';


	import { spotAuth, naviExperience, spotArGoods, arGoodsPlaceOrder, orderPay} from '@/api/home';
	import { payNow } from '@/utils';
	import store from '@/store';

	import scenic from './components/scenic.vue';

	export default {
		components: { custom_navbar, map_nav,  scenic },
		data() {
			return {
				is_dev: this.$store.getters.fileDeploy?.maps?.mock_open,
				navigateTo,
				modalShow: true,
				theme: 'dark',
				NavHeight_infoHeight: uni.getSystemInfoSync().screenHeight,
				spotAuth: { experience_end_time_stamp: 1 },
				is_pay: true,
				spotArGoods_obj: {},
				scenic_detail: JSON.parse(uni.getStorageSync('scenic_detail')) || {},
				loading: false,
				mock_open: this.$store.getters.mock_open,
				is_read:1,
				switch_value: true,
				//景点推荐路线
				id:0,
				spot_id:0,
			};
		},
		onLoad(options) {
			var rec_params = {};
		    if (options.spot_id) {
		        this.spot_id = Number(options.spot_id);
				rec_params.spot_id = Number(options.spot_id);
		    }
			if (options.id) {
				this.id = Number(options.id);
				rec_params.id = Number(options.id);
			}
			uni.setStorageSync('rec_params',rec_params);
		},
		onShow(){
		
		},
		computed: {
			map_nav_type_computed() {
				return this.$store.getters.map_nav_type;
			},
		},
		watch: {
			map_nav_type_computed(newValue, oldValue) {
				if (newValue == oldValue) return;
				this.observer_map_nav(newValue);
			},
		},
		beforeDestroy() {
			store.commit('userInfo/set_audio_show', true);
		},
		onUnload() {
			store.commit('userInfo/set_is_login_popup', false);
		},
		created() {},
		async mounted() {
			//景点打卡过来切换map_nav
			if (this.scenic_detail.from == 'punch') {
				this.$store.commit('map/set_map_nav_type', 'map_nav');
			}
			
			this.getinfoHeight();
		},
		methods: {
			mock_change(value) {
				this.$store.commit('map/set_mock_open', value);
			},
			// 获取头的高度
			getNavHeight(e) {
				this.NavHeight_infoHeight += e;
			},
			getinfoHeight(e) {
				let view = uni.createSelectorQuery().in(this).select('#info');
				view
					.boundingClientRect((data) => {
						console.log('得到布局位置信息' + JSON.stringify(data.height));
						this.NavHeight_infoHeight += data.height;
					})
					.exec();
			},
			
		},
	};
</script>

<style lang="scss" scoped>
	.content {
		background: url('https://resources.ym2meta.com/web-smart-tour/ar_bg.png') no-repeat;
		background-size: 100% 100%;

		::v-deep .u-count-down__text {
			color: red !important;
		}
	}
	.info_box{ width: 100%; height: auto; display: flex; position: fixed; z-index: 20; bottom: 242px;}
	.info_box_left{ width: 340rpx;}
	.info_box_right{ width: auto; padding-left: 160rpx;}
	.ai_button{
		width: auto;
		height: 60rpx;
		background: #FFFFFF;
		border-radius: 48rpx 48rpx 48rpx 48rpx;
		display: flex;
		margin: 10rpx auto;
	}
	.ai_button_left{
		width: 48rpx;
		height: 48rpx;
	}
	.ai_button_left image{
		margin-top: 6rpx;
		width: 48rpx;
		height: 48rpx;
		}
	.ai_button_center{
		width: 24rpx;
		height: 0rpx;
		border: 2rpx solid #E8EDEC;
	}
	.ai_button_right{
		width: auto;
		padding-top: 6rpx;
	}
</style>
